package io.github.kouleen.manager.domain;

import java.util.Objects;

/**
 * @author zhangqing
 * @since 2025/1/25 14:17
 */
public class TaskScheduledVO {
    private Long id;
    private String taskCode;
    private String taskName;
    private String cronExpression;
    private String taskCommand;
    private Integer taskStatus;

    public TaskScheduledVO() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTaskCode() {
        return this.taskCode;
    }

    public void setTaskCode(String taskCode) {
        this.taskCode = taskCode;
    }

    public String getTaskName() {
        return this.taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getCronExpression() {
        return this.cronExpression;
    }

    public void setCronExpression(String cronExpression) {
        this.cronExpression = cronExpression;
    }

    public String getTaskCommand() {
        return this.taskCommand;
    }

    public void setTaskCommand(String taskCommand) {
        this.taskCommand = taskCommand;
    }

    public Integer getTaskStatus() {
        return this.taskStatus;
    }

    public void setTaskStatus(Integer taskStatus) {
        this.taskStatus = taskStatus;
    }

    @Override
    public boolean equals(Object obj) {
        if (Objects.isNull(obj)) return false;
        if (obj instanceof TaskScheduledVO) {
            TaskScheduledVO taskScheduledDTO = (TaskScheduledVO) obj;
            // 执行命令
            return this.getTaskCommand().equals(taskScheduledDTO.getTaskCommand())
                    // 时间表达式
                    && this.getCronExpression().equals(taskScheduledDTO.getCronExpression())
                    // 装填
                    && this.getTaskStatus().equals(taskScheduledDTO.getTaskStatus());
        }
        return false;
    }
}
